package controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import service.UserService;

import java.util.Date;
import java.util.Map;

/**
 * Created by 小泽玛丽罗 on 2016/10/8.
 */
@Controller
public class ViewCOntroller {
    @Value("${application.message:1234556677}")
    private String message = "hi,hello world......";
    @Autowired
    private UserService userService;

    @RequestMapping("/web")
    public String hello(Map<String,Object> model){
        model.put("time",new Date());
        model.put("message","dasasdada");
        model.put("users",userService.getAll());
        return "web";//返回的内容就是templetes下面文件的名称
    }
}
